1. Field of the Invention
The present invention relates to a method of allocating a basic input/output system to a shadow memory, and more particularly, to a method of allocating a basic input/output system to a shadow memory so that an optimum allocation is achieved to increase the number of equipment to be enabled.
2. Description of the Prior Art
In 1981, IBM started to write hardware program code for power on and subprogram codes for basic periphery input/output processing (such as displaying on a monitor or driving the floppy disk) into a read-only memory (ROM) when designing a personal computer. This code is called a basic input/output system (BIOS), and the memory for storing the program code is called an operation read only memory (operation ROM). When the computer is powered on, a microporcessor retrieves program codes from the read only memory, which store the basic input/output system, on a motherboard to acquire control power from the program codes representing the basic input/output system and starts to function. The jobs of power on self test (POST), reading pre setting data (for example: size for hard disk, system timing), and driving peripheries such as a hard disk and an optical disk are therefore performed. Additionally, the basic input/output system is not only established on the motherboard, but also many powerful equipment is embedded with the operation read only memory storing the basic input/output system. For example, a display card (VGA), a small computer system interface (SCSI) card, a three-dimensional (3D) accelerating card, a local area network (LAN) card, and a redundant array of independent device (RAID) card.
Since the operation speed of an operation read only memory storing the basic input/output system is much slower than that of a common dynamic random access memory (DRAM), manufacturers of personal computers usually scheme to copy the data in the operation read only memory into the dynamic random access memory when power on. When the operational system needs to utilize the functions or commands in the basic input/output system, the functions and commands can be executed in the dynamic random access memory, which has a quicker operation speed in comparison with the read only memory, to improve the total operation of system. The dynamic random access memory used for storing the basic input/output system is called a shadow memory. The shadow memory has already become a necessary device for executing particular functions on the motherboard. The shadow memory is between the address of C000:0000 to F000:FFFF in the memory of the computer. According to the segment of real mode addressing means, the shadow memory is divided into a C segment (C000:0000 to C000:FFFF), a D segment (D000:0000 to D000:FFFF), an E segment (E000:0000 to E000:FFFF), and an F segment (F000:0000 to F000:FFFF). The capacity of each segment is 64 KB. However, not only the basic input/output system of the computer stored in the operation read only memory is copied to the shadow memory, the basic input/output system of the equipment stored in the read only memory perhaps needs to be copied into the shadow memory to improve efficiency. In addition, the peripheral component interface (PCI), which has become a mainstream in recent years, clearly defines the initialization procedures for copying data to the shadow memory. The shadow memory thus becomes the necessary device for enabling equipment.
In the now existing computer configuration, the capacity of the shadow memory is normally 256 KB. The segment C is allocated to the display card having a capacity of 32 KB. The segment E and the segment F are allocated to the basic input/output system of the motherboard. As a result, the capacity of the space allocated to other equipment usually does not exceed 96 KB (256−32 −64−64=96).
At present, the basic input/output system is allocated to the shadow memory according to the order of installation. Please refer to FIG. 1. FIG. 1 is a flow chart of a prior art method for allocating the basic input/output system to the shadow memory. As shown in FIG. 1, the basic input/output system acquires the configuration of the first equipment after the computer is powered on, as shown in step 11.
The basic input/output system then determines in step 12 if there is an operation read only memory of the first equipment to be initialized. If there is, execute step 13; if there is not, go to step 16 to determine if the first equipment is the last equipment.
The basic input/output system can acquire the required capacity for initializing the operation read only memory of the equipment from the equipment configuration, and determines if the usable capacity of the shadow memory is sufficient to initialize the operation read only memory of the equipment in step 13. If it is, execute step 14. If is not, execute step 15 to record an error of not having enough shadow memory and come back to step 16.
In step 14, the basic input/output system will assign the operation read only memory of the equipment an address and a specific size in the shadow memory, according to the required capacity when initializing the operation read only memory. The specific size is equal to the size of the operation read only memory. The data in the operation read only memory is then copied to the assigned space in the shadow memory to execute initialization and to correct the usable capacity of the shadow memory. That means, the capacity of the space assigned to the initialized operation read only memory is subtracted from the remaining usable capacity of the shadow memory. In addition, only the data in some portion of the operation read only memory, depending on requirements, is necessary to be stored in the shadow memory to be used as a service routine during executing, after the operation read only memory is initialized to the shadow memory. Therefore, the capacity required by the operation read only memory in the shadow memory prior to initialization could be different from that after initialization.
After step 14 is completed, go to step 16. The basic input/output system will determine if the equipment mentioned in previous steps is the last equipment. If it is not, execute step 17 to acquire the configuration of the next equipment. Then come back to step 12 to execute step 12 to step 16, which have been previously mentioned, continuously. If the equipment is the last equipment, execute step 18. It is worth noticing that the basic input/output system usually acquires the configuration of all of the equipment, except the equipment to be assigned with higher priority, according to the order of installation. For example, since a display card is a very important equipment in a computer system, the configuration of the display card is normally acquired first. After that, each of the remaining equipment is allocated to the shadow memory according to the order of installation.
In step 18, the basic input/output system will determine if the error of not having enough shadow memory occurs. If so, execute step 19 and end the power-on procedure. If not, display an error message of not having enough shadow memory on the display to inform the user in step 19.
Owing to the limited usable space of the shadow memory, some of the equipment is not able to be enabled when there are several equipment having an operation read only memory, such as the interface card, are installed in the computer. As a result, some augment functions are not available. These situations frequently happened to this level of computer, such as a workstation and a server. Please refer to FIG. 2. FIG. 2 is an exemplary table for showing the prior art method of allocating the basic input/output system to the shadow memory. As shown in FIG. 2, if a VGA card (such as an ATI VGA card), a RAID card (such as an IBM ServeRAID-4L card), two SCSI equipment (for example, the first SCSI equipment is an Adaptec 29160 SCSI card, the second SCSI equipment is a LSI MPI SCSI card), and a LAN card (such as a Broadcom NetXtreme Gigabit Ethernet LAN card) are installed in the computer in sequence, the basic input/output system will first allocate the shadow memory to the display card. Since the usable capacity of the shadow memory is 128 KB, which is larger than the capacity of the operation read only memory of the display card 32 KB, the display card can be enabled successfully. Later, the RAID card and the first SCSI equipment can be sequentially enabled due to sufficient usable capacity in the shadow memory. However, the subsequent equipment, such as the second SCSI equipment and the LAN card, can not be enabled successfully because the usable capacity of the shadow memory is smaller than the capacity of the operation read only memory of both equipment, bringing a lot of perplexity to the user.
Nowadays, some of the basic input/output systems shut off the function of allocating the operation read only memories of specific equipment to the shadow memory to allow the other equipment having an operation read only memory to be enabled successfully. This method will no doubt reduce equipment efficiency. It is therefore very important to allocate the limited space in the shadow memory more efficiently to increase the number of equipment to be enabled. As previously mentioned, the capacity of the operation read only memory of each equipment prior to initialization could be different from that after initialization. For example, the capacity of the operation read only memory of the first SCSI equipment is 44 KB prior to initialization, and the capacity of the operation read only memory of the first SCSI equipment becomes 21 KB after initialization. The unutilized space, resulting from this difference, is ignored because the basic input/output system regards that this space has been allocated to a specific equipment. If the usable capacity of the shadow memory is corrected to the size of subtracting the capacity of the read only memory after initialization, the problem of inefficient utilizing the space in the shadow memory is avoided. For example, the usable capacity of the shadow memory after the first SCSI equipment is initialized to 43 KB, rather than 20 KB. Furthermore, the difference of capacity between the non-initialized operation read only memory and the initialized operation read only memory may allow the shadow memory to be able to accommodate the capacity of the operation read only memory after initialization, but to not be able to accommodate the capacity of the operation read only memory prior to initialization. Thus, if the order of allocating the shadow memory is changed, this operation read only memory is able to be allocated to the shadow memory. That means, to change the order of allocating the shadow memory will increase the number of equipment to be enabled.
It is therefore very important to automatically analyze the capacity of the operation read only memories of the equipment after being initialized, by utilizing preliminary initialization, to allow each of the equipment to be initialized according to the order of the capacity of the operation read only memories, from smallest capacity to largest capacity. The shadow memory is allocated more effectively to increase the number of equipment to be enabled.